﻿using System;
using System.Text;

namespace RaGE
{
    internal class EChoice
    {
        public int Control;
        public byte[] ChoiceText;

        public string GetText()
        {
            var encoding = Encoding.GetEncoding("Unicode");
            return encoding.GetString(ChoiceText);
        }

        public void SetText(string value)
        {
            var encoding = Encoding.GetEncoding("Unicode");
            var array = new byte[132];
            var bytes = encoding.GetBytes(value);

            Array.Copy(bytes, array, array.Length > bytes.Length ? bytes.Length : array.Length);

            ChoiceText = array;
        }
    }
}
